#include "link_list.h"
//1为管理员
//0为普通用户
Elenemt_data manager_data[50] = 
{
 { .name = "刘备" , .sex = "男" , .password= 1 , .age = 18 , .account= 1 , .grade = 1},
 { .name = "貂蝉" , .sex = "女" , .password= 10 , .age = 18 ,.account= 10, .grade = 1}
};

Elenemt_data common_data[50] = {};

void test(void)
{
    Link_list * L = init_link_list();
    Node * new_node = (Node *)malloc(sizeof(Node)); // 创建结点
    L->next = new_node; // 将结点 链接到 头节点
    L->next->data = manager_data[0];
    //与用户交互
    printf("请输入你的账号和密码\n");
    int account;
    int password;
    scanf("%d %d" , &account , &password);
    //登录
    Node * p = register_list(L ,account , password );
    if (p == NULL)
    {
        printf("账号或密码错误\n");
        return ;
    }
    else
    {
        printf("登录成功\n");
    }
    printf("%d\n" , p->data.grade) ;
    print_link_list(L);
}

int main(int argc, char const *argv[])
{
    test();
    return 0;
}